#include "keylist.h"

char const* keynames[256] = {
/*00*/  0, "LBUTTON", "RBUTTON", /*VK_CANCEL*/0, "MBUTTON", "XBUTTON1", "XBUTTON2", 0,
/*08*/  "BACKSPACE", "TAB", "WHEELLEFT", "WHEELRIGHT", /*VK_CLEAR*/0, "ENTER", "WHEELUP", "WHEELDOWN",
/*10*/  "SHIFT", "CONTROL", "ALT", "PAUSE", "CAPSLOCK", /*VK_KANA*/0, 0, /*VK_JUNJA*/0,
/*18*/  /*VK_FINAL*/0, /*VK_HANJA*/0, 0, "ESCAPE", /*VK_CONVERT*/0, /*VK_NONCONVERT*/0, /*VK_ACCEPT*/0, /*VK_MODECHANGE*/0,
/*20*/  "SPACE", "PAGEUP", "PAGEDOWN", "END", "HOME", "LEFT", "UP", "RIGHT",
/*28*/  "DOWN", /*VK_SELECT*/0, /*VK_PRINT*/0, /*VK_EXECUTE*/0, "PRINTSCREEN", "INSERT", "DELETE", /*VK_HELP*/0,
/*30*/  "0", "1", "2", "3", "4", "5", "6", "7",
/*38*/  "8", "9", 0, 0, 0, 0, 0, 0,
/*40*/    0, "A", "B", "C", "D", "E", "F", "G",
/*48*/  "H", "I", "J", "K", "L", "M", "N", "O",
/*50*/  "P", "Q", "R", "S", "T", "U", "V", "W",
/*58*/  "X", "Y", "Z", "LWIN", "RWIN", "APPS", 0, /*VK_SLEEP*/0,
/*60*/  "NUM0", "NUM1", "NUM2", "NUM3", "NUM4", "NUM5", "NUM6", "NUM7",
/*68*/  "NUM8", "NUM9", "MULTIPLY", "ADD", /*SEPARATOR*/0, "SUBTRACT", "DECIMAL", "DIVIDE",
/*70*/  "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8",
/*78*/  "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16",
/*80*/  "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24",
/*88*/  0, 0, 0, 0, 0, 0, 0, 0,
/*90*/  "NUMLOCK", "SCROLLLOCK", 0, 0, 0, 0, 0, 0,
/*98*/  0, 0, 0, 0, 0, 0, 0, 0,
/*A0*/  "LSHIFT", "RSHIFT", "LCONTROL", "RCONTROL", "LALT", "RALT", "BROWSER_BACK", "BROWSER_FORWARD",
/*A8*/  "BROWSER_REFRESH", "BROWSER_STOP", "BROWSER_SEARCH", "BROWSER_FAVORITES", "BROWSER_HOME", "VOLUME_MUTE", "VOLUME_DOWN", "VOLUME_UP",
/*B0*/  "MEDIA_NEXT", "MEDIA_PREV", "MEDIA_STOP", "MEDIA_PLAY", "LAUNCH_MAIL", "LAUNCH_MEDIA", "LAUNCH_APP1", "LAUNCH_APP2",
/*B8*/  0, 0, ";", "=", ",", "-", ".", "/",
/*C0*/  "`", 0, 0, 0, 0, 0, 0, 0,
/*C8*/  0, 0, 0, 0, 0, 0, 0, 0,
/*D0*/  0, 0, 0, 0, 0, 0, 0, 0,
/*D8*/  0, 0, 0, "[", "\\", "]", "'", /*VK_OEM_8*/0,
/*E0*/  0, 0, /*VK_OEM_102*/0, 0, 0, /*VK_PROCESSKEY*/0, 0, /*VK_PACKET*/0,
/*E8*/  0, 0, 0, 0, 0, 0, 0, 0,
/*F0*/  0, 0, 0, 0, 0, 0, /*VK_ATTN*/0, /*VK_CRSEL*/0,
/*F8*/  /*VK_EXSEL*/0, /*VK_EREOF*/0, /*VK_PLAY*/0, /*VK_ZOOM*/0, /*VK_NONAME*/0, /*VK_PA1*/0, /*VK_OEM_CLEAR*/0,
};

#define S   0x400

unsigned short chartokey[256] = {
/*00*/  0, 0, 0, 0, 0, 0, 0, 0,
/*08*/  '\b', '\t', 0x0D, 0, 0, 0, 0, 0,
/*10*/  0, 0, 0, 0, 0, 0, 0, 0,
/*18*/  0, 0, 0, 0x1B, 0, 0, 0, 0,
/*20*/  ' ', S+'1', S+0xDE, S+'3', S+'4', S+'5', S+'7', 0xDE,
/*28*/  S+'9', S+'0', S+'8', S+0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
/*30*/  '0', '1', '2', '3', '4', '5', '6', '7',
/*38*/  '8', '9', S+0xBA, 0xBA, S+0xBC, 0xBB, S+0xBE, S+0xBF,
/*40*/  S+'2', S+'A', S+'B', S+'C', S+'D', S+'E', S+'F', S+'G',
/*48*/  S+'H', S+'I', S+'J', S+'K', S+'L', S+'M', S+'N', S+'O',
/*50*/  S+'P', S+'Q', S+'R', S+'S', S+'T', S+'U', S+'V', S+'W',
/*58*/  S+'X', S+'Y', S+'Z', 0xDB, 0xDC, 0xDD, S+'6', S+0xBD,
/*60*/  0xC0, 'A', 'B', 'C', 'D', 'E', 'F', 'G',
/*68*/  'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
/*70*/  'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
/*78*/  'X', 'Y', 'Z', S+0xDB, S+0xDC, S+0xDD, S+0xC0, 0,

/*80*/  0, 0, 0, 0, 0, 0, 0, 0,
/*88*/  0, 0, 0, 0, 0, 0, 0, 0,
/*90*/  0, 0, 0, 0, 0, 0, 0, 0,
/*98*/  0, 0, 0, 0, 0, 0, 0, 0,
/*A0*/  0, 0, 0, 0, 0, 0, 0, 0,
/*A8*/  0, 0, 0, 0, 0, 0, 0, 0,
/*B0*/  0, 0, 0, 0, 0, 0, 0, 0,
/*B8*/  0, 0, 0, 0, 0, 0, 0, 0,
/*C0*/  0, 0, 0, 0, 0, 0, 0, 0,
/*C8*/  0, 0, 0, 0, 0, 0, 0, 0,
/*D0*/  0, 0, 0, 0, 0, 0, 0, 0,
/*D8*/  0, 0, 0, 0, 0, 0, 0, 0,
/*E0*/  0, 0, 0, 0, 0, 0, 0, 0,
/*E8*/  0, 0, 0, 0, 0, 0, 0, 0,
/*F0*/  0, 0, 0, 0, 0, 0, 0, 0,
/*F8*/  0, 0, 0, 0, 0, 0, 0, 0,
};
unsigned char mousekeys[256] = {
/*00*/  0, 1, 1, 0, 1, 1, 1, 0,
/*08*/  0, 0, 1, 1, 0, 0, 1, 1,
/*10*/  0, 0, 0, 0, 0, 0, 0, 0,
/*18*/  0, 0, 0, 0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